package com.bestsoft.flow.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bestsoft.flow.mapper.FlowUserSupplyMapper;
import com.bestsoft.flow.domain.FlowUserSupply;
import com.bestsoft.flow.service.IFlowUserSupplyService;

/**
 * 用户和供应商关联Service业务层处理
 * 
 * @author wj
 * @date 2023-09-04
 */
@Service
public class FlowUserSupplyServiceImpl implements IFlowUserSupplyService 
{
    @Autowired
    private FlowUserSupplyMapper flowUserSupplyMapper;

    /**
     * 查询用户和供应商关联
     * 
     * @param userId 用户和供应商关联主键
     * @return 用户和供应商关联
     */
    @Override
    public FlowUserSupply selectFlowUserSupplyByUserId(Long userId)
    {
        return flowUserSupplyMapper.selectFlowUserSupplyByUserId(userId);
    }

    /**
     * 查询用户和供应商关联列表
     * 
     * @param flowUserSupply 用户和供应商关联
     * @return 用户和供应商关联
     */
    @Override
    public List<FlowUserSupply> selectFlowUserSupplyList(FlowUserSupply flowUserSupply)
    {
        return flowUserSupplyMapper.selectFlowUserSupplyList(flowUserSupply);
    }

    /**
     * 新增用户和供应商关联
     * 
     * @param flowUserSupply 用户和供应商关联
     * @return 结果
     */
    @Override
    public int insertFlowUserSupply(FlowUserSupply flowUserSupply)
    {
        return flowUserSupplyMapper.insertFlowUserSupply(flowUserSupply);
    }

    /**
     * 修改用户和供应商关联
     * 
     * @param flowUserSupply 用户和供应商关联
     * @return 结果
     */
    @Override
    public int updateFlowUserSupply(FlowUserSupply flowUserSupply)
    {
        return flowUserSupplyMapper.updateFlowUserSupply(flowUserSupply);
    }

    /**
     * 批量删除用户和供应商关联
     * 
     * @param userIds 需要删除的用户和供应商关联主键
     * @return 结果
     */
    @Override
    public int deleteFlowUserSupplyByUserIds(String[] supplycode)
    {
        return flowUserSupplyMapper.deleteFlowUserSupplyByUserIds(supplycode);
    }

    /**
     * 删除用户和供应商关联信息
     * 
     * @param userId 用户和供应商关联主键
     * @return 结果
     */
    @Override
    public int deleteFlowUserSupplyByUserId(Long userId)
    {
        return flowUserSupplyMapper.deleteFlowUserSupplyByUserId(userId);
    }
}
